package com.hualan.web;

import com.hualan.pojo.HotCourse;
import com.hualan.pojo.Teachers;
import com.hualan.pojo.WenZhang;
import com.hualan.service.service.service.TeachersService;
import com.hualan.service.service.service.WenZhangService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/teachers")
public class TeachersController {
    @Autowired
    private TeachersService teachersService;
    @Autowired
    private WenZhangService wenZhangService;
    @RequestMapping("/list")
    List<Teachers> teachersList(){
        return teachersService.teachersList();
    }

    @RequestMapping("/findById")
    Teachers findById(Integer id){
        System.out.println("===========");
        return  teachersService.findById(id);
    }
    @RequestMapping("/teacherscourse")
    List<HotCourse> courseList(Integer tid){
        return teachersService.courseList(tid);
    }
    @RequestMapping("/wenzhang")
    List<WenZhang> wenzhanglist(Integer tid){
        return wenZhangService.wenzhanglist(tid);
    }
}
